package com.controller;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.entity.User;
import com.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2018/8/24.
 */
@Controller
@RequestMapping("/user")
public class UserContrller {

    @Autowired
    private IUserService iUserService;

    @ResponseBody
    @RequestMapping(path = "/showUser.do")
    public Map<String,Object> showUser(Long id) {
        Map<String,Object> j=new HashMap<>();
        User user = iUserService.selectUser(id);
        j.put("user",user);
        return j;
    }
}
